// 硬编码
function checkAge1(age) {
  let min = 18;
  return age >= min;
}

// 普通的纯函数
function checkAge2(min, age) {
  return age >= min;
}

function checkAge3(min) {
  return function (age) {
    return age >= min;
  }
}

// ES6+
let checkAge4 = min => (age => age >= min)

let fn18 = checkAge4(18);
let fn20 = checkAge4(20);

console.log(fn18(20))
console.log(fn20(18))